{% extends "base_self.html" %}


{%block title%}分页列表测试{%endblock%}
{%block stylesheet%}
{{super()}}
{%endblock%}
{%block script%}{{super()}}{%endblock%}
{%block banner%}{%endblock%}
{% block main %}
<h3 class='pagination-page-info'>共有<b>{{pagination.total}}</b>条数据,分<b>{{pagination.pages}}</b>页展示</h3>
<ul class='pagination'>
  {%if pagination.has_prev%}
  <li><a href="{{url_for('paginate_test',page=pagination.page-1)}}"><</a></li>
  {%else%}
  <li class='disabled'><a><</a></li>
  {%endif%}

  {%for page in pagination.iter_pages(1,1,2,1)%}
  {%if page%}
    {%if page == pagination.page %}
    <li class= 'active'><a href="{{url_for('paginate_test',page=page)}}">{{page}}</a></li>
    {%else%}
    <li><a href="{{url_for('paginate_test',page=page)}}">{{page}}</a></li>
    {%endif%}
  {%else%}
    <li class='disabled'><a href="#">&hellip;</a></li>
  {%endif%}
  {%endfor%}

  {%if pagination.has_next%}
  <li><a href="{{url_for('paginate_test',page=pagination.page+1)}}">></a></li>
  {%else%}
  <li class='disabled'><a>></a></li>
  {%endif%}
</ul>

{%for item in pagination.items%}
<article class="latestpost">
  <div class="articalpic">
    <img class="recent-artical" src="./static/img/tiance.jpg" alt="文章推荐1">
  </div>
  <div class="articalcontent">
    <a href="#" class='articaltitle'>{{item[2]}}</a>
    <p class='publishtime'>{{item[0]}}</p>

    <p class="articalrecommedate">{{item[1]}}<a href="#">前往查看</a></p>
  </div>
</article>
{%endfor%}

{%endblock%}
